<include file="Base/header" />
<link href="__PUBLIC__/css/mycss.css" rel="stylesheet" type="text/css"/>
<div class="page-container">
    <include file="Base/menu" />
    <div class="page-content">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title">
                    </h3>
                    <ul class="breadcrumb">
                            <li>
                                    <i class="icon-home">
                                    </i>
                                    <a href="/index.php/Admin/">
                                            首页
                                    </a>
                                    <i class="icon-angle-right">
                                    </i>
                            </li>
                            <li>
                                    <a href="/index.php/Admin/Article">
                                            资讯管理
                                    </a>
                            </li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <div class="row-fluid">
                <div class="span12">
                    <!-- BEGIN EXAMPLE TABLE PORTLET-->
                    <div class="portlet box blue">
                        <div class="portlet-title">
                                <div class="caption">
                                        <i class="icon-edit">
                                        </i>
                                        栏目列表
                                </div>
                                <div class="tools">
                                        <a href="javascript:;" class="collapse">
                                        </a>
                                        <a href="#portlet-config" data-toggle="modal" class="config">
                                        </a>
                                        <a href="javascript:;" class="reload">
                                        </a>
                                        <a href="javascript:;" class="remove">
                                        </a>
                                </div>
                        </div>
                        <div class="portlet-body">
                            <div class="clearfix">
                                        <div class="btn-group">
                                                <a id="sample_editable_1_new" class="btn green" href="__URL__/Classify_add">
                                                        增加栏目
                                                        <i class="icon-plus">
                                                        </i>
                                                </a>
                                        </div>
                                </div>
            <table class="table table-striped table-hover table-bordered" id="sample_editable_1">
                    <thead>
                            <tr>
                                    <th>
                                            id
                                    </th>
                                    <th>
                                            栏目
                                    </th>
                                    
                                
                                    <th>
                                            删除
                                    </th>
                                    </th>
                            </tr>
                    </thead>
                    <tbody>
                    <foreach name="data" item="vo">
                            <tr class="">
                                    <td>
                                            {$vo.id}
                                    </td>
                                    <td>
                                             <a class="edit" href="__MODULE__/Article/Index?id={$vo.id}">
                                            {$vo.title}
                                            </a>
                                    </td>
                                    
                                    
                                       <td>
                                        <a class="edit" onclick="to_delete({$vo.id})">
                                              删除
                                        </a>
                                    </td>
                            </foreach>
                    </tbody>
            </table>


<!-- 分页 -->
<div class="row-fluid">
    <div class="span6">
        <div class="dataTables_info" id="sample_1_info">
          共{$count}条数据记录。
        </div>
    </div>
    <div class="span6">
        <div class="dataTables_paginate paging_bootstrap pagination">
            {$page}
        </div>
    </div>
</div>
                                                </div>
                                        </div>
                                </div>
                                <!-- END EXAMPLE TABLE PORTLET-->
                        </div>
                </div>
        </div>
</div>
</div>
<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>

<script type="text/javascript">
        function to_delete(id){
        layer.alert('确定删除？',function(close){
            pullRequest(id);
            layer.close(close);
        })
        function pullRequest(id){
            $.ajax({
                type:'POST',
                dataType: "json",
                url: "{:U('Admin/Article/classify_del')}",
                data: {"id":id},
                success:  function(result){
                    if(result.status==1){
                        layer.alert(result.info,function(){self.location="__MODULE__/Article/Classify";});
                    }else if(result.status==0){
                        //失败
                        layer.alert(result.info);
                    }
                }
            });
        }
    } 
</script>
<include file="Base/footer" />